home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / DYN401.ZIP / class / strdict.c < prev    next >
C/C++ Source or Header  |  1997-04-16  |  3KB  |  138 lines

  1.  
  2.  
  3. /*  Copyright (c) 1993-1996 Algorithms Corporation  */
  4. /*  All rights reserved.  */
  5.  
  6.  
  7.  
  8.  
  9. /*  This file automatically generated by dpp - do not edit  */
  10.  
  11. #define    DPP_STRATEGY    2
  12. #define    DPP_FASTWIDE    0
  13.  
  14.  
  15.  
  16.  
  17. #define    CLASS    StringDictionary_c
  18. #define    ivType    StringDictionary_iv_t
  19.  
  20. #include "generics.h"
  21.  
  22. object    StringDictionary_c;
  23.  
  24.  
  25. #line 23 "strdict.d"
  26. #include "set1.h" 
  27.  
  28. #define LTYPE 2 
  29.  
  30. static gLookup_t Lookup; 
  31.  
  32. imeth objrtn StringDictionary_im_gAddStr(object self, char *key, object value)
  33.     ChkArgNul(value, 3); 
  34.     return Lookup(self, (object) key, HT_ADD, 0, LTYPE, value); 
  35.  
  36. imeth objrtn StringDictionary_im_gFindValueStr(object self, char *key)
  37.     object x = Lookup(self, (object) key, HT_FIND, 0, LTYPE, NULL); 
  38.     return x ? gValue(x) : x; 
  39.  
  40. imeth objrtn StringDictionary_im_gFindStr(object self, char *key)
  41.     return Lookup(self, (object) key, HT_FIND, 0, LTYPE, NULL); 
  42.  
  43. imeth objrtn StringDictionary_im_gChangeValueWithStr(object self, char *key, object val)
  44.     object x; 
  45.     ChkArgNul(val, 3); 
  46.     x = Lookup(self, (object) key, HT_FIND, 0, LTYPE, NULL); 
  47.     return x ? gChangeValue(x, val) : x; 
  48.  
  49. imeth objrtn StringDictionary_im_gFindAddStr(object self, char *key, object value)
  50.     ChkArgNul(value, 3); 
  51.     return Lookup(self, (object) key, HT_FINDADD, 0, LTYPE, value); 
  52.  
  53. imeth objrtn StringDictionary_im_gDispose(object self)
  54.     return gDispose1(self); 
  55.  
  56. imeth objrtn StringDictionary_im_gDisposeAllNodes(object self)
  57.     return gDisposeAllNodes1(self); 
  58.  
  59. imeth objrtn StringDictionary_im_gRemoveStr(object self, char *key)
  60.     return Lookup(self, (object) key, HT_DELETE, 1, LTYPE, NULL); 
  61.  
  62. imeth objrtn StringDictionary_im_gDeepDisposeStr(object self, char *key)
  63.     return Lookup(self, (object) key, HT_DELETE, 2, LTYPE, NULL); 
  64.  
  65. static void init_class(void) 
  66.     Lookup = imcPointer(Set, gLookup); 
  67.  
  68. #line 89 "strdict.c"
  69.  
  70. objrtn    StringDictionary_initialize(void)
  71. {
  72.     static  CRITICALSECTION  cs;
  73.     static  int volatile once = 0;
  74.  
  75.     ENTERCRITICALSECTION(_CI_CS_);
  76.     if (!once) {
  77.         INITIALIZECRITICALSECTION(cs);
  78.         once = 1;
  79.     }
  80.     LEAVECRITICALSECTION(_CI_CS_);
  81.  
  82.     ENTERCRITICALSECTION(cs);
  83.  
  84.     if (StringDictionary_c) {
  85.         LEAVECRITICALSECTION(cs);
  86.         return StringDictionary_c;
  87.     }
  88.     INHIBIT_THREADER;
  89.     Set_initialize();
  90.     if (StringDictionary_c)  {
  91.         ENABLE_THREADER;
  92.         LEAVECRITICALSECTION(cs);
  93.         return StringDictionary_c;
  94.     }
  95.     StringDictionary_c = gNewClass(Class, "StringDictionary", 0, 0, Set, END);
  96.     iMethodFor(StringDictionary, gRemoveStr, StringDictionary_im_gRemoveStr);
  97.     iMethodFor(StringDictionary, gDisposeStr, StringDictionary_im_gDeepDisposeStr);
  98.     iMethodFor(StringDictionary, gFindStr, StringDictionary_im_gFindStr);
  99.     iMethodFor(StringDictionary, gAddStr, StringDictionary_im_gAddStr);
  100.     iMethodFor(StringDictionary, gDisposeAllNodes, StringDictionary_im_gDisposeAllNodes);
  101.     iMethodFor(StringDictionary, gDispose, StringDictionary_im_gDispose);
  102.     iMethodFor(StringDictionary, gFindAddStr, StringDictionary_im_gFindAddStr);
  103.     iMethodFor(StringDictionary, gChangeValueWithStr, StringDictionary_im_gChangeValueWithStr);
  104.     iMethodFor(StringDictionary, gFindValueStr, StringDictionary_im_gFindValueStr);
  105.     iMethodFor(StringDictionary, gDeepDisposeStr, StringDictionary_im_gDeepDisposeStr);
  106.  
  107.     init_class();
  108.  
  109.     ENABLE_THREADER;
  110.  
  111.     LEAVECRITICALSECTION(cs);
  112.  
  113.     return StringDictionary_c;
  114. }
  115.  
  116.  
  117.  
  118.